package edu.cuc.socket.url.Socket;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;

public class SocketDemo01 {
    public static void main(String[] args) {
        try {
            Socket client = null;
            client = new Socket("127.0.0.1", 8888);
            BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
            String string = reader.readLine();
            PrintStream printStream = new PrintStream(client.getOutputStream());
            printStream.print("akb48");
            System.out.println(string);
        } catch (Exception ex) {
            ex.printStackTrace();
        }


    }
}
